package com.example.transfer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class EntryFragActivityActivity extends Activity {
    private static final String WANT_PARAMS = "params";
    private static final String LOG_TAG = "[EntryFragActivityActivity]";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent intent = getIntent();
        String params = "";
        if (intent != null) {
            params = intent.getStringExtra(WANT_PARAMS);
            Log.i(LOG_TAG, "params is " + params);
        }

        Button btn1 = findViewById(R.id.btn1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(EntryFragActivityActivity.this, EntryArkuiAbilityActivity.class);
                Bundle args = new Bundle();
                args.putString("params", "{\"params\":[{\"key\":\"content\",\"type\":10,\"value\":\"参数来自原生activity\"}," +
                        "{\"key\":\"from\",\"type\":10,\"value\":\"button\"}]}");
                intent.putExtras(args);
                startActivity(intent);
            }
        });
    }

}